package com.zuoye.Test;

import com.zuoye.Opjo.Class;
import com.zuoye.Opjo.Student;
import com.zuoye.Service.ClaSerIntImpl;
import com.zuoye.Service.ClaStuIntIpml;
import com.zuoye.Service.ClaStuInterface;
import com.zuoye.Service.StuSerIntImpl;

import java.util.ArrayList;
import java.util.List;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/30  18:15
 * @Copyright
 */
public class Test {

    @org.junit.Test
    public void testStuInsert() {
        final StuSerIntImpl stuSerInt = new StuSerIntImpl();
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student(2, "孙越", 26, 176.36, "男", "2021-07-29 13:46:12", 5));
        final int i = stuSerInt.addStuSer(list);
        System.out.println(i);
    }

    @org.junit.Test
    public void testStuDelete() {
        final StuSerIntImpl stuSerInt = new StuSerIntImpl();
        final int i = stuSerInt.delStuSer(11);
        System.out.println("i = " + i);
    }

    @org.junit.Test
    public void testStuUpdate() {
        final StuSerIntImpl stuSerInt = new StuSerIntImpl();
        final Student student = new Student(5, "周建国", 66, 163.5, "男", "1997-11-11 15:13:44", 15);
        final int i = stuSerInt.updStuSer(student);
        System.out.println("i = " + i);
    }

    @org.junit.Test
    public void testStuquery() {
        final StuSerIntImpl stuSerInt = new StuSerIntImpl();
        final ArrayList<Student> students = stuSerInt.queStuSer(new Student());
        students.stream().forEach(System.out::println);
    }

    @org.junit.Test
    public void testClaInsert() {
        final ClaSerIntImpl claSerInt = new ClaSerIntImpl();
        final ArrayList<Class> list = new ArrayList<>();
        list.add(new Class(1, "一班", 2, "2017-07-30 18:30:46"));
        final int i = claSerInt.intClaSer(list);
        System.out.println("i = " + i);

    }

    @org.junit.Test
    public void testClaDelete() {
        final ClaSerIntImpl claSerInt = new ClaSerIntImpl();
        final int i = claSerInt.delClaSer(1);
        System.out.println("i = " + i);
    }

    @org.junit.Test
    public void testCLaUpdate() {
        final ClaSerIntImpl claSerInt = new ClaSerIntImpl();
        final Class aClass = new Class(1, "jd1s1", 26, "2017-07-20 18:30:46");
        final int i = claSerInt.updClaSer(aClass);
        System.out.println("i = " + i);
    }

    @org.junit.Test
    public void testClaquery() {
        ClaSerIntImpl claSerInt = new ClaSerIntImpl();
        ArrayList<Class> classes = claSerInt.queClaSer(new Class());
        classes.stream().forEach(System.out::println);
    }


    @org.junit.Test
    public void TestInertClaStu() {
        final ClaStuIntIpml claStuIntIpml = new ClaStuIntIpml();
        claStuIntIpml.addClaStu(null, null);
    }


    @org.junit.Test
    public void TestDelClaStu() {
        final ClaStuIntIpml claStuIntIpml = new ClaStuIntIpml();
        final int i = claStuIntIpml.delClaStu(100);
        System.out.println("i = " + i);
    }


    @org.junit.Test
    public void TestupdClaStu() {
        final ClaStuIntIpml claStuIntIpml = new ClaStuIntIpml();
        final int i = claStuIntIpml.updClaStu(11, 1);
        System.out.println("i = " + i);
    }

    @org.junit.Test
    public void TestqueClaStu() {
        final ClaStuIntIpml claStuIntIpml = new ClaStuIntIpml();
        final ArrayList<?> objects = claStuIntIpml.queClaStu();
        System.out.println("objects = " + objects);
    }
}
